Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SITL: add ENABLED defines for remaining simulated I2C devices #28848

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

srmainwaring
Copy link
Contributor

@srmainwaring srmainwaring commented Dec 12, 2024

Adds conditional compilation defines for the remainder of the I2C sensors included in SIM_I2C.cpp.

Motivation

Aside from consistency, this reduces DRAM use for SIM on HW (esp. esp32empty and esp32s3empty where RAM limits are causing WiFi to not initialise correctly).

cd ./build/esp32s3empty/esp-idf_build
ninja -v -v size-files | grep SIM_I2C.cpp

Before:

Object File DRAM .data .bss IRAM .text RAM Total Flash .text .rodata Flash Total
SIM_I2C.cpp.0.o 116 20620 0 20736 867 184 1167

After:

Object File DRAM .data .bss IRAM .text RAM Total Flash .text .rodata Flash Total
SIM_I2C.cpp.0.o 36 3984 0 4020 71 24 131

See also:

libraries/SITL/SIM_Airspeed_DLVR.h Outdated Show resolved Hide resolved
@srmainwaring srmainwaring force-pushed the prs/prs-sitl-i2c-defines branch 2 times, most recently from a758871 to 035d4e4 Compare December 14, 2024 14:29
@srmainwaring srmainwaring force-pushed the prs/prs-sitl-i2c-defines branch from 035d4e4 to 92b8e86 Compare December 14, 2024 14:32
@peterbarker peterbarker merged commit 70fe304 into ArduPilot:master Dec 14, 2024
99 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants